#ifndef CONFIG_H
#define CONFIG_H

#include <string>

class Config
{
public:

    static Config *getInstance()
    {
        if(m_config == NULL)
        {
            m_config = new Config();
        }
        return m_config;
    }

    Config();

    ~Config() {}

    std::string getSIPDomain() const
    {
        return m_sipDomain;
    }

    std::string getSIPProxy() const
    {
        return m_sipProxy;
    }

    std::string getSIPRegistar() const
    {
        return m_sipRegistar;
    }

    int getSIPPort() const
    {
        return m_sipPort;
    }

    int getRtpPort() const
    {
        return m_rtpPort;
    }

    std::string getP2PServer()const
    {
        return m_p2pServer;
    }

    int getP2PServerPort()const
    {
        return m_p2pPort;
    }

    std::string getStunServer()const
    {
        return m_stunServer;
    }

    int getStunPort() const
    {
        return m_stunPort;
    }

    const std::string getServiceConfigFile() const
    {
        return m_serviceConfigFile;
    }

    void setSIPDomain(const std::string domain);

    void setSIPProxy(const std::string proxy);

    void setSIPRegistar(const std::string registar);

    void setSIPPort(int port);

    void setRtpPort(int port);

    void setP2PServer(const std::string server);

    void setP2PPort(int port);

    void setStunServer(const std::string server);

    void setStunPort(int port);

    void setServiceConfigFile(const std::string filename);

private:

    void init();

    static Config *m_config;

    std::string m_sipDomain;

    std::string m_sipRegistar;

    std::string m_sipProxy;

    std::string m_p2pServer;

    std::string m_serviceConfigFile;

    int m_sipPort;

    int m_rtpPort;

    int m_p2pPort;

    std::string m_stunServer;

    int m_stunPort;

};
#endif
